function axios({
	url,
	method = 'get',
	data
}) {
	method = method.toUpperCase()
	return new Promise((relove, reject) => {
		wx.showLoading({
		  title: '加载中....',
		})
		wx.request({
			url,
			header: {
				Authorization: `Bearer ${wx.getStorageSync('token')}`
			},
			method,
			data,
			success: ({
				data
			}) => {
				relove(data)
			},
			fail: (err) => {
				reject(err)
			},
			complete:()=>{
				wx.hideLoading()
			}

		})
	})


}
module.exports = axios

